<!DOCTYPE html>
<html lang="en">
<head>
{{template "pc/public/mycss.html" .}}
</head>
<style type="text/css">
	#wrapper{
		background: #f5f5f5!important;
	}
	.header-center{
		background: #fff;
	}
	.user_left{
		background: #fff;
	}
	.fenlei{
		width: 20%;
	}
	
	@media (max-width: 992px){
		.fenlei{
		    width: 100%;
		}
	}
</style>
<body class="common-home res layout-home1 setinvoice">
<div id="wrapper" class="wrapper-full banners-effect-7">
	<!-- Header Container  -->
  {{template "pc/public/head.html" .}}
  {{template "pc/public/mytop.html" .}}
	<div class="main-container container">
		<div class="row mb-50">
			<!--Left Part Start -->
			 {{template "pc/public/myleft.html" .}}
			<!--Middle Part Start-->
			<div id="content" class="col-md-10 col-sm-8 right mt-15">
        <p class="hd">我的发票</p>
        <form>
        <div>
          <dl>
            <dt>抬头</dt>
            <dd><input name="look" type="text" value="{{.info.look}}" placeholder="请输入抬头"></dd>
          </dl>
          <dl>
            <dt>税号</dt>
            <dd><input type="text" value="{{.info.ein}}" placeholder="请输入税号" name="ein"></dd>
          </dl>
          <dl>
            <dt>开户银行</dt>
            <dd><input type="text" placeholder="请输入开户行" value="{{.info.bank}}" name="bank"></dd>
          </dl>
          <dl>
            <dt>银行账号</dt>
            <dd><input type="text" placeholder="请输入银行账号" value="{{.info.account}}" name="account"></dd>
          </dl>
          <dl>
            <dt>地址</dt>
            <dd><input type="text" placeholder="请输入地址" value="{{.info.address}}" name="address"></dd>
          </dl>
          <input type="hidden" name="id" value="{{.info.id}}">
        </div>
        </form>
        <button id="save">保存发票</button>
      </div>
		</div>
	</div>
</div>

<!-- Footer Container -->
{{template "pc/public/foot.html" .}}
{{template "pc/public/myfoot.html" .}}
</body>
</html>
<script type="text/javascript">
  $('#save').click(function(){
    var form=$('form').serialize()
    if(!$('input[name="look"]').val()){showToast('请输入抬头!'); return false; };
    if(!$('input[name="ein"]').val()){showToast('请输入税号!'); return false; };
    if(!$('input[name="bank"]').val()){showToast('请输入开户行!'); return false; };
    if(!$('input[name="account"]').val()){showToast('请输入银行账号!'); return false; };
    if(!$('input[name="address"]').val()){showToast('请输入地址!'); return false; };
    $.ajax({
      url:window.location.href,
      type:'post',
      data:form,
      success:function(res){
        if (res==1) {
          showToast("保存成功!");
          setTimeout(function(){history.go(0)}, 1000)
        }else{
          showToast("网络繁忙,请稍后再试!");
        }
      }
    })
  })
</script>
